<template>
<div>
  <div style="margin-bottom:20px">
   <span  style="color:#ccc">目前只支持云服务打印机,需要开通打印服务请联系客服购买,订购热线:13860431130"</span>

  </div>
   <el-form label-width="150px">
    <el-form-item label="请输入云打印账号">
      <el-input style="width: 300px" v-model="userInfo.printeru"></el-input>
    </el-form-item>
    <el-form-item label="请输入云打印密码">
      <el-input
        type="password"
        style="width: 300px"
        v-model="userInfo.printerp"
      ></el-input>
    </el-form-item>
    <el-button style="margin-left:20px" type="primary" v-permission="['parameter.edit']" @click="submit">设置</el-button>
  </el-form>
</div>

</template>
<script>
import { getInfo, updateMchShop } from "@/api/shop";
import permission from "@/directive/permission/index.js"; // 权限判断指令
export default {
    directives: { permission },
  data() {
    return {
      userInfo: {},
    };
  },
  created() {
    this.getInfo();
  },
  methods: {
    getInfo() {
      getInfo()
        .then((res) => {
          this.userInfo = res.data;
          console.log(this.userInfo);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    submit() {
      updateMchShop(this.userInfo).then((res) => {
        console.log(res);
         this.$message.success("修改成功");
         this.getInfo()
      })
       .catch((err) => {
          console.log(err);
        });;
    },
  },
};
</script>

<style >
</style>
